function AdfRichPlainTextEditor(a){this.Init(a)}AdfObject.createSubclass(AdfRichPlainTextEditor,AdfRichInlineEditor);AdfRichPlainTextEditor._extraWidth=0;AdfRichPlainTextEditor.prototype.Init=function(a){AdfAssert.assertString(a);AdfRichPlainTextEditor.superclass.Init.call(this);this._propertyName=a};AdfRichPlainTextEditor.prototype.PreEdit=function(){return null!=this.GetEditedDomElement()};AdfRichPlainTextEditor.prototype.getEditedProperty=function(){return this._propertyName}; AdfRichPlainTextEditor.prototype.startEdit=function(a,b){AdfRichPlainTextEditor.superclass.startEdit.call(this,a,b);var c=this.GetEditedPeer().getDomDocument(),d=c.createElement("input");d.type="text";var e=AdfAgent.AGENT,f=a.getProperty(this._propertyName);d.value=f;a._orgininalEditValue=f;f=this.GetEditedDomElement();e.copyStyle(f,d);var g=d.style;g.position="absolute";g.MozBoxSizing&&(g.MozBoxSizing=null);g.zIndex=1;AdfRichPlainTextEditor._textArea=d;AdfRichPlainTextEditor._extraWidth="left"== g.textAlign?20:0;c=c.body;c.insertBefore(d,c.firstChild);this._updateTextAreaPosition(d,f);f.style.visibility="hidden";AdfFocusUtils.focusElementDelayed(d,1);c=AdfRichPlainTextEditor._commitEditStub;e.addBubbleEventListener(d,"keyup",c);e.addBubbleEventListener(d,"keypress",c);a.addEventListener("propertyChange",this._syncFromPropertyChange,this);e.addEventBubbles(d,AdfRichPlainTextEditor._handleEditorEventStub)}; AdfRichPlainTextEditor.prototype.stopEdit=function(){this._commitEdit();this._finishEdit();AdfRichPlainTextEditor.superclass.stopEdit.call(this)}; AdfRichPlainTextEditor.prototype._handleEditorEvent=function(a){if("blur"==a.type)AdfPage.PAGE.setEditedComponent(null,a);else if("keyup"==a.type)switch(AdfAgent.AGENT.getKeyCode(a)){case AdfKeyStroke.ESC_KEY:var b=this.getEditedComponent();AdfRichPlainTextEditor._textArea.value=b._orgininalEditValue;AdfPage.PAGE.setEditedComponent(null,a);break;case AdfKeyStroke.ENTER_KEY:(a.altKey||!a.ctrlKey&&!a.shiftKey)&&AdfPage.PAGE.setEditedComponent(null,a);break;case AdfKeyStroke.TAB_KEY:AdfPage.PAGE.setEditedComponent(null, a)}};AdfRichPlainTextEditor.prototype.GetEditedDomElement=function(){return this.GetEditedPeer().getDomElement()};AdfRichPlainTextEditor.prototype._commitEdit=function(){this.getEditedComponent().setProperty(this._propertyName,AdfRichPlainTextEditor._textArea.value,!0)}; AdfRichPlainTextEditor.prototype._finishEdit=function(){var a=this.getEditedComponent();a._orgininalEditValue=null;a.removeEventListener("propertyChange",this._syncFromPropertyChange,this);var a=AdfRichPlainTextEditor._textArea,b=AdfAgent.AGENT,c=AdfRichPlainTextEditor._commitEditStub;b.removeBubbleEventListener(a,"keypress",c);b.removeBubbleEventListener(a,"keyup",c);b.removeEventBubbles(a,AdfRichPlainTextEditor._handleEditorEventStub);b=this.GetEditedDomElement();b.ownerDocument.body.removeChild(a); b.style.visibility="visible";AdfRichPlainTextEditor._textArea=null;AdfRichPlainTextEditor._extraWidth=0};AdfRichPlainTextEditor._commitEditStub=function(){var a=AdfPage.PAGE.getEditedComponent();null!=a&&(a=a.getPeer().getInlineEditor(a),null!=a&&(AdfAssert.assertPrototype(a,AdfRichPlainTextEditor),a._commitEdit()))}; AdfRichPlainTextEditor._handleEditorEventStub=function(a){a=a?a:window.event;var b=AdfPage.PAGE.getEditedComponent();null!=b&&(b=b.getPeer().getInlineEditor(b),null!=b&&(AdfAssert.assertPrototype(b,AdfRichPlainTextEditor),b._handleEditorEvent(a)))}; AdfRichPlainTextEditor.prototype._syncFromPropertyChange=function(a){if(a.getPropertyName()==this._propertyName){var b=AdfRichPlainTextEditor._textArea,c=this.GetEditedDomElement();this._updateTextAreaPosition(b,c);a=a.getNewValue();null==a&&(a="");b.value!=a&&(b.value=a)}}; AdfRichPlainTextEditor.prototype._updateTextAreaPosition=function(a,b){var c=a.style,d=AdfAgent.AGENT,e=d.getElementPageBounds(b),f=e.left;c.top=e.top+"px";c.left=f+"px";d.setOuterWidth(a,b.offsetWidth+AdfRichPlainTextEditor._extraWidth);d.setOuterHeight(a,b.offsetHeight)}; function AdfDhtmlSimpleLabelEditor(){this.Init("label")}AdfObject.createSubclass(AdfDhtmlSimpleLabelEditor,AdfRichPlainTextEditor);AdfDhtmlSimpleLabelEditor.getInlineEditor=function(){var a=AdfDhtmlSimpleLabelEditor._INLINE_EDITOR;null==a&&(a=new AdfDhtmlSimpleLabelEditor,AdfDhtmlSimpleLabelEditor._INLINE_EDITOR=a);return a}; AdfDhtmlSimpleLabelEditor.prototype.GetEditedDomElement=function(){if(void 0==this.getEditedComponent().getProperty("label"))return null;var a=this.GetEditedPeer().getDomElement();return AdfDomUtils.getFirstDescendentElement(a,"LABEL")}; function AdfDhtmlSimpleTextEditor(a){this.Init(a)}AdfObject.createSubclass(AdfDhtmlSimpleTextEditor,AdfRichPlainTextEditor);AdfDhtmlSimpleTextEditor.prototype.Init=function(a){AdfDhtmlSimpleTextEditor.superclass.Init.call(this,"text");AdfAssert.assertString(a);this._wrapperElementName=a};AdfDhtmlSimpleTextEditor.getInlineEditor=function(){var a=AdfDhtmlSimpleTextEditor._INLINE_EDITOR;null==a&&(a=new AdfDhtmlSimpleTextEditor("span"),AdfDhtmlSimpleTextEditor._INLINE_EDITOR=a);return a}; AdfDhtmlSimpleTextEditor.getAnchorInlineEditor=function(){var a=AdfDhtmlSimpleTextEditor._ANCHOR_INLINE_EDITOR;null==a&&(a=new AdfDhtmlSimpleTextEditor("a"),AdfDhtmlSimpleTextEditor._ANCHOR_INLINE_EDITOR=a);return a}; AdfDhtmlSimpleTextEditor.prototype.GetEditedDomElement=function(){var a=this.getEditedComponent();if(void 0==a.getProperty("text"))return null;var b=this.GetEditedPeer().getDomElement(),d=AdfDomUtils.getFirstDescendentElement(b,this._wrapperElementName);return d?(a=a.getProperty("accessKey",null),null!=a?AdfDomUtils.findAccessKeyDom(b,a)==d?b:d:d):b}; function AdfDhtmlButtonTextEditor(a){this.Init("text")}AdfObject.createSubclass(AdfDhtmlButtonTextEditor,AdfRichPlainTextEditor);AdfDhtmlButtonTextEditor.getInlineEditor=function(){var a=AdfDhtmlButtonTextEditor._INLINE_EDITOR;null==a&&(a=new AdfDhtmlButtonTextEditor,AdfDhtmlButtonTextEditor._INLINE_EDITOR=a);return a}; AdfDhtmlButtonTextEditor.prototype.GetEditedDomElement=function(){var a=this.getEditedComponent(),b=this.GetEditedPeer().getDomElement();return AdfDhtmlCommandButtonPeer.getInlineEditableTextElement(a,b)};AdfDhtmlButtonTextEditor.prototype.stopEdit=function(){var a=this.getEditedComponent(),b=this.GetEditedPeer().getDomElement();AdfDhtmlButtonTextEditor.superclass.stopEdit.call(this);AdfDhtmlCommandButtonPeer.stopInlineEditableTextElement(a,b)}; function AdfDhtmlNavigationItemTextEditor(a){this.Init("text")}AdfObject.createSubclass(AdfDhtmlNavigationItemTextEditor,AdfRichPlainTextEditor);AdfDhtmlNavigationItemTextEditor.getInlineEditor=function(){var a=AdfDhtmlNavigationItemTextEditor._INLINE_EDITOR;null==a&&(a=new AdfDhtmlNavigationItemTextEditor,AdfDhtmlNavigationItemTextEditor._INLINE_EDITOR=a);return a}; AdfDhtmlNavigationItemTextEditor.prototype.GetEditedDomElement=function(){var a=this.getEditedComponent();if(!a.getProperty("text"))return null;var b=this.GetEditedPeer().getDomElement();return AdfDhtmlCommandNavigationItemPeer.getInlineEditableTextElement(a,b)}; function AdfDhtmlSelectBooleanTextEditor(){this.Init("text")}AdfObject.createSubclass(AdfDhtmlSelectBooleanTextEditor,AdfRichPlainTextEditor);AdfDhtmlSelectBooleanTextEditor.prototype.GetEditedDomElement=function(){var a=this.GetEditedPeer().getDomElement();return AdfDhtmlSelectBooleanCheckboxPeer.__getInlineEditableTextElement(a)};